/<template>
  <div>
    <h1>我的</h1>
    <div v-if="isLogin == 'true'">
      已登录<b>{{ user.username }}</b>
    </div>
    <div v-else>未登录</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isLogin: localStorage.getItem("isLogin"),
      user: localStorage.getItem("user")
        ? JSON.parse(localStorage.getItem("user"))
        : {},
    };
  },
};
</script>

<style>
</style>